#pragma once 
//typedef typename std::map<int, Node*> Graph;
std::ostream& operator<< (std::ostream& out, const std::map<int, Node*>& graph) {

    out << "digraph G" << std::endl << "{" << std::endl;
    out << "rankdir=LR" << std::endl;
    for(auto iter = graph.begin(); iter != graph.end()  ; ++iter)
    {
        for(auto outGoingIter = iter->second->nexts.begin() ; outGoingIter != iter->second->nexts.end() ; ++outGoingIter)
        {
            size_t multiplicity = outGoingIter->second->multiplicity ;
            out<< iter->first<< " -> " << outGoingIter->second->toNode->id;
            out<<" [label= \" " << multiplicity << "  " ;  
            for(auto posIter = outGoingIter->second->toNode->pos.begin(); posIter != outGoingIter->second->toNode->pos.end(); ++posIter)
                out << " : " << *posIter ;
            out << " \" ]"<<std::endl;
        }

    }


    return out<< "}";
}
